﻿#region Using Directives

    using System;

    using Csla;

    using MarketPulse.Reporting.Core;

#endregion

namespace MarketPulse.Reporting.Core.Criteria
{
    /// <summary>
    /// Criteria class specifying a ClientGUID and CountryGUID.
    /// </summary>
    [Serializable]
    public class ClientGUIDAndCountryGUIDAndResultsDateRangeCriteria : CriteriaBase<ClientGUIDAndCountryGUIDAndResultsDateRangeCriteria>
    {

        #region Constructors

            /// <summary>
            /// Default constructor for this class
            /// </summary>
            /// <param name="clientGUID">The GUID of the Client to associate with this criteria</param>                      
            /// <param name="countryGUID">The GUID of the Country to associate with this criteria</param>       
            /// <param name="language">The language identifier (ie. en or fr) to use when localising text from the database.</param>   
            /// <param name="currentStartDateTime">The start date of the reporting period.</param>
            /// <param name="currentEndDateTime">The end date of the reporting period.</param>
            /// <param name="dataStartDateTime">The start date of when to retrieve data.</param>
            /// <param name="dataEndDateTime">The end date of when to retrieve data.</param>
            public ClientGUIDAndCountryGUIDAndResultsDateRangeCriteria(Nullable<Guid> clientGUID, Nullable<Guid> countryGUID, string language, DateTime currentStartDateTime, DateTime currentEndDateTime, DateTime dataStartDateTime, DateTime dataEndDateTime)
            {
                ClientGUID = clientGUID;
                CountryGUID = countryGUID;
                Language = language;
                CurrentStartDateTime = currentStartDateTime;
                CurrentEndDateTime = currentEndDateTime;
                DataStartDateTime = dataStartDateTime;
                DataEndDateTime = dataEndDateTime;
            }

        #endregion

        #region Properties

            /// <summary>
            /// This GUID is used to identify the Client object associated with this criteria
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> ClientGUIDProperty = RegisterProperty<Nullable<Guid>>(p => p.ClientGUID);
            /// <summary>
            /// This GUID is used to identify the Client object associated with this criteria
            /// </summary>
            public Nullable<Guid> ClientGUID
            {
                get { return ReadProperty(ClientGUIDProperty); }
                private set { LoadProperty(ClientGUIDProperty, value); }
            }

            /// <summary>
            /// This GUID is used to identify the Country associated with this criteria
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> CountryGUIDProperty = RegisterProperty<Nullable<Guid>>(p => p.CountryGUID);
            /// <summary>
            /// This GUID is used to identify the Country associated with this criteria
            /// </summary>
            public Nullable<Guid> CountryGUID
            {
                get { return ReadProperty(CountryGUIDProperty); }
                private set { LoadProperty(CountryGUIDProperty, value); }
            }

            /// <summary>
            /// This is the language identifier (ie. en or fr) to use when localising text from the database.
            /// </summary>
            public static PropertyInfo<string> LanguageProperty = RegisterProperty<string>(p => p.Language);
            /// <summary>
            /// This is the language identifier (ie. en or fr) to use when localising text from the database.
            /// </summary>
            public string Language
            {
                get { return ReadProperty(LanguageProperty); }
                private set { LoadProperty(LanguageProperty, value); }
            }

            /// <summary>
            /// The CurrentStartDateTime associated with this criteria object. This is the Current reporting period.
            /// </summary>
            public static PropertyInfo<DateTime> CurrentStartDateTimeProperty = RegisterProperty<DateTime>(p => p.CurrentStartDateTime);
            /// <summary>
            /// The CurrentStartDateTime associated with this criteria object. This is the Current reporting period.
            /// </summary>
            public DateTime CurrentStartDateTime
            {
                get { return ReadProperty(CurrentStartDateTimeProperty); }
                private set { LoadProperty(CurrentStartDateTimeProperty, value); }
            }

            /// <summary>
            /// The CurrentEndDateTime associated with this criteria object. This is the Current reporting period.
            /// </summary>
            public static PropertyInfo<DateTime> CurrentEndDateTimeProperty = RegisterProperty<DateTime>(p => p.CurrentEndDateTime);
            /// <summary>
            /// The CurrentEndDateTime associated with this criteria object. This is the Current reporting period.
            /// </summary>
            public DateTime CurrentEndDateTime
            {
                get { return ReadProperty(CurrentEndDateTimeProperty); }
                private set { LoadProperty(CurrentEndDateTimeProperty, value); }
            }

            /// <summary>
            /// The DataStartDateTime associated with this criteria object. This is the date range for retrieving actual data.
            /// </summary>
            public static PropertyInfo<DateTime> DataStartDateTimeProperty = RegisterProperty<DateTime>(p => p.DataStartDateTime);
            /// <summary>
            /// The DataStartDateTime associated with this criteria object. This is the date range for retrieving actual data.
            /// </summary>
            public DateTime DataStartDateTime
            {
                get { return ReadProperty(DataStartDateTimeProperty); }
                private set { LoadProperty(DataStartDateTimeProperty, value); }
            }

            /// <summary>
            /// The DataEndDateTime associated with this criteria object. This is the date range for retrieving actual data.
            /// </summary>
            public static PropertyInfo<DateTime> DataEndDateTimeProperty = RegisterProperty<DateTime>(p => p.DataEndDateTime);
            /// <summary>
            /// The DataEndDateTime associated with this criteria object. This is the date range for retrieving actual data.
            /// </summary>
            public DateTime DataEndDateTime
            {
                get { return ReadProperty(DataEndDateTimeProperty); }
                private set { LoadProperty(DataEndDateTimeProperty, value); }
            }

        #endregion

    }
}
